package com.qx.chat.system.entity;

import java.io.Serializable;
import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection="qx_chat_messageRecord")
public class ChatMessageRecord implements Serializable{
	
	private static final long serialVersionUID = -1172048358405425648L;
	//用户普通聊天记录
	public static final Integer USERMSGRECORD = 0;
	//群聊天记录
	public static final Integer GROUPMSGRECORD = 1;
	//已读
	public static final Integer READ = 1;
	//未读
	public static final Integer NOREAD = 0;
	
	@Id
	private String id;
	//发件人
	@DBRef
	private User speakerUser;
	private String speakerUserId;
	//听众用户
	@DBRef
	private User audienceUser;
	private String audienceUserId;
	//听众群
	private Group audienceGroup;
	private String audienceGroupId;
	//时间
	private Date occureTime;
	//内容
	private String contentRtf;
	//聊天记录类型  默认为普通用户记录
	private Integer chatType = USERMSGRECORD;
	
	private Integer isRead = NOREAD;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public User getAudienceUser() {
		return audienceUser;
	}
	public void setAudienceUser(User audienceUser) {
		this.audienceUser = audienceUser;
	}
	public Date getOccureTime() {
		return occureTime;
	}
	public void setOccureTime(Date occureTime) {
		this.occureTime = occureTime;
	}
	public String getContentRtf() {
		return contentRtf;
	}
	public void setContentRtf(String contentRtf) {
		this.contentRtf = contentRtf;
	}
	public Integer getChatType() {
		return chatType;
	}
	public void setChatType(Integer chatType) {
		this.chatType = chatType;
	}
	public User getSpeakerUser() {
		return speakerUser;
	}
	public void setSpeakerUser(User speakerUser) {
		this.speakerUser = speakerUser;
	}
	public String getSpeakerUserId() {
		return speakerUserId;
	}
	public void setSpeakerUserId(String speakerUserId) {
		this.speakerUserId = speakerUserId;
	}
	public String getAudienceUserId() {
		return audienceUserId;
	}
	public void setAudienceUserId(String audienceUserId) {
		this.audienceUserId = audienceUserId;
	}
	public String getAudienceGroupId() {
		return audienceGroupId;
	}
	public void setAudienceGroupId(String audienceGroupId) {
		this.audienceGroupId = audienceGroupId;
	}
	public Group getAudienceGroup() {
		return audienceGroup;
	}
	public void setAudienceGroup(Group audienceGroup) {
		this.audienceGroup = audienceGroup;
	}
	public Integer getIsRead() {
		return isRead;
	}
	public void setIsRead(Integer isRead) {
		this.isRead = isRead;
	}
	
}
